class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: C = None
        self.x: F = None
        self.r: C = None
        self.txt = txt

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

i = A("i")
a = B("a")
h = C("h")
g = D("g")
m = E("m")
e = F("e")
b = E("b")
d = F("d")
f = C("f")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: C = None
        self.x: F = None
        self.r: C = None
        self.txt = txt

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

i = A("i")
a = B("a")
h = C("h")
g = D("g")
m = E("m")
e = F("e")
b = E("b")
d = F("d")
f = C("f")

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