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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: B = None
        self.z: D = None
        self.y: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: C = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: A = None
        self.q: B = None
        self.o: D = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

i = A("i")
j = B("j")
k = C("k")
b = D("b")
a = E("a")
h = F("h")
m = G("m")
c = B("c")
d = F("d")

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: B = None
        self.z: D = None
        self.y: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: C = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: A = None
        self.q: B = None
        self.o: D = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

i = A("i")
j = B("j")
k = C("k")
b = D("b")
a = E("a")
h = F("h")
m = G("m")
c = B("c")
d = F("d")

i.q = j
j.u = k
j.x = c
j.y = c
j.z = b
k.w = m
k.u = a
k.z = a
k.p = a
k.q = c
b.x = k
a.z = c
a.o = k
a.t = b
h.y = i
h.p = i
h.q = c
h.o = b
h.s = a
m.p = a
c.u = k
c.x = j
c.y = j
c.z = b
d.y = i
d.p = i
d.q = j
d.o = b
d.s = a
assert a.o.u.z.y.txt == "j"