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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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