class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: C = None
        self.r: B = None
        self.s: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: C = None
        self.y: A = None
        self.z: D = None
        self.txt = txt

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

i = A("i")
f = B("f")
h = C("h")
e = D("e")
l = E("l")
n = F("n")
a = B("a")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: C = None
        self.y: A = None
        self.z: D = None
        self.txt = txt

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

i = A("i")
f = B("f")
h = C("h")
e = D("e")
l = E("l")
n = F("n")
a = B("a")

i.t = e
i.w = h
i.r = a
i.s = a
f.u = l
f.p = n
h.q = i
h.w = l
e.x = l
l.u = e
l.z = e
l.t = h
l.y = i
n.t = e
n.v = e
n.y = l
n.r = l
n.z = i
n.o = a
a.u = l
a.p = n
assert a.p.o.p.txt == "n"