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

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

g = A("g")
d = B("d")
e = C("e")
n = D("n")
i = E("i")
c = F("c")
k = E("k")
f = D("f")
h = F("h")
a = B("a")

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

g = A("g")
d = B("d")
e = C("e")
n = D("n")
i = E("i")
c = F("c")
k = E("k")
f = D("f")
h = F("h")
a = B("a")

g.x = a
d.s = n
d.o = c
d.v = h
d.q = g
e.o = d
e.t = k
e.y = g
e.r = n
e.u = i
e.p = h
n.w = h
i.u = e
i.y = d
c.w = i
c.p = i
c.u = d
c.z = n
c.y = n
c.r = h
k.u = e
k.y = d
f.w = c
h.w = k
h.p = i
h.u = d
h.z = n
h.r = c
h.y = f
a.s = f
a.o = h
a.v = c
a.q = g
assert i.u.u.y.q.x.txt == "a"