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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: F = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: F = None
        self.q: E = None
        self.txt = txt

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

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

g.t = i
g.q = m
i.u = e
i.x = e
h.r = e
h.q = g
h.u = b
e.x = h
e.q = h
e.w = j
e.r = m
e.o = b
j.w = i
j.z = b
j.q = d
b.p = i
b.o = e
b.t = e
b.z = g
b.u = h
d.w = i
d.z = b
d.q = j
m.t = i
m.q = g
assert e.w.w.x.x.u.p.u.txt == "e"