class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: F = None
        self.z: B = None
        self.v: F = None
        self.y: B = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: F = None
        self.x: B = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: D = None
        self.t: D = None
        self.y: D = None
        self.s: E = None
        self.r: D = None
        self.txt = txt

g = A("g")
d = B("d")
j = C("j")
i = D("i")
h = E("h")
k = F("k")
c = B("c")

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: F = None
        self.x: B = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: D = None
        self.t: D = None
        self.y: D = None
        self.s: E = None
        self.r: D = None
        self.txt = txt

g = A("g")
d = B("d")
j = C("j")
i = D("i")
h = E("h")
k = F("k")
c = B("c")

g.q = k
g.w = k
g.v = k
g.z = d
g.p = d
g.y = c
d.q = g
d.o = k
d.z = i
d.p = j
j.v = h
j.q = h
i.o = d
i.y = g
h.r = k
h.w = k
h.x = d
h.p = c
k.x = g
k.o = i
k.t = i
k.y = i
k.r = i
k.s = h
c.q = g
c.o = k
c.z = i
c.p = j
assert k.s.x.o.o.o.z.txt == "i"