class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: E = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: D = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: B = None
        self.v: E = None
        self.s: D = None
        self.y: G = None
        self.p: E = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.z: E = None
        self.u: B = None
        self.w: E = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: G = None
        self.z: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: E = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: D = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: B = None
        self.v: E = None
        self.s: D = None
        self.y: G = None
        self.p: E = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.z: E = None
        self.u: B = None
        self.w: E = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: G = None
        self.z: F = None
        self.txt = txt

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

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