class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: D = None
        self.o: D = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: B = None
        self.txt = txt

g = A("g")
f = B("f")
e = C("e")
n = D("n")
h = E("h")
a = A("a")

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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: B = None
        self.txt = txt

g = A("g")
f = B("f")
e = C("e")
n = D("n")
h = E("h")
a = A("a")

g.p = f
g.t = n
g.o = n
g.s = n
f.y = h
f.z = e
f.q = e
e.t = n
n.t = h
n.u = e
h.y = e
h.x = f
a.p = f
a.t = n
a.o = n
a.s = n
assert n.u.t.t.txt == "h"