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

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

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

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

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

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

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

h.o = f
h.z = c
h.r = b
h.q = e
i.t = c
i.q = b
i.z = b
i.x = g
e.v = k
e.q = f
e.r = i
b.o = f
b.s = k
b.w = k
b.p = k
b.y = e
c.q = g
c.t = i
c.w = h
c.s = f
c.o = k
f.r = g
g.o = f
g.s = k
g.p = k
g.w = i
g.y = e
k.t = c
k.q = b
k.z = g
k.x = g
assert c.q.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: E = None
        self.r: D = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

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