class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: D = None
        self.q: D = None
        self.w: B = None
        self.z: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: B = None
        self.s: C = None
        self.w: E = None
        self.v: B = None
        self.txt = txt

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

c = A("c")
j = B("j")
g = C("g")
f = D("f")
b = E("b")
i = C("i")
d = E("d")
e = D("e")
k = D("k")
h = B("h")

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: B = None
        self.s: C = None
        self.w: E = None
        self.v: B = None
        self.txt = txt

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

c = A("c")
j = B("j")
g = C("g")
f = D("f")
b = E("b")
i = C("i")
d = E("d")
e = D("e")
k = D("k")
h = B("h")

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