class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: F = None
        self.u: C = None
        self.x: B = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: A = None
        self.w: C = None
        self.u: E = None
        self.o: C = None
        self.s: A = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: H = None
        self.z: F = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: G = None
        self.q: B = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: B = None
        self.t: E = None
        self.z: C = None
        self.v: H = None
        self.u: A = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: E = None
        self.txt = txt

i = A("i")
j = B("j")
c = C("c")
b = D("b")
f = E("f")
e = F("e")
m = G("m")
d = H("d")

i.v = j
i.x = j
i.w = e
i.u = c
i.r = m
j.y = m
j.p = i
j.s = i
j.w = c
j.o = c
j.u = f
j.t = b
c.p = f
c.v = d
c.s = d
c.z = e
b.o = d
f.o = m
f.x = m
f.u = m
f.q = j
e.t = d
e.v = i
m.r = e
m.y = e
m.p = j
m.t = f
m.z = c
m.v = d
m.u = i
d.o = b
d.v = f
assert f.q.t.o.v.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: F = None
        self.u: C = None
        self.x: B = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: A = None
        self.w: C = None
        self.u: E = None
        self.o: C = None
        self.s: A = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: H = None
        self.z: F = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: G = None
        self.q: B = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: B = None
        self.t: E = None
        self.z: C = None
        self.v: H = None
        self.u: A = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: E = None
        self.txt = txt

i = A("i")
j = B("j")
c = C("c")
b = D("b")
f = E("f")
e = F("e")
m = G("m")
d = H("d")

i.v = j
i.x = j
i.w = e
i.u = c
i.r = m
j.y = m
j.p = i
j.s = i
j.w = c
j.o = c
j.u = f
j.t = b
c.p = f
c.v = d
c.s = d
c.z = e
b.o = d
f.o = m
f.x = m
f.u = m
f.q = j
e.t = d
e.v = i
m.r = e
m.y = e
m.p = j
m.t = f
m.z = c
m.v = d
m.u = i
d.o = b
d.v = f
assert f.q.t.o.v.q.y.txt == "m"