class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: B = None
        self.u: B = None
        self.v: C = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: D = None
        self.q: E = None
        self.z: B = None
        self.s: C = None
        self.txt = txt

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

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

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

j = A("j")
b = B("b")
h = C("h")
c = D("c")
l = E("l")
a = B("a")
g = B("g")

j.t = h
j.v = h
j.r = a
j.u = b
j.o = l
b.u = g
b.z = g
b.p = c
b.q = l
b.s = h
h.p = l
c.w = j
c.x = j
c.p = h
c.o = h
l.y = b
a.u = b
a.z = b
a.p = c
a.q = l
a.s = h
g.u = b
g.p = c
g.q = l
g.z = a
g.s = h
assert h.p.y.p.o.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: B = None
        self.u: B = None
        self.v: C = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: D = None
        self.q: E = None
        self.z: B = None
        self.s: C = None
        self.txt = txt

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

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

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

j = A("j")
b = B("b")
h = C("h")
c = D("c")
l = E("l")
a = B("a")
g = B("g")

j.t = h
j.v = h
j.r = a
j.u = b
j.o = l
b.u = g
b.z = g
b.p = c
b.q = l
b.s = h
h.p = l
c.w = j
c.x = j
c.p = h
c.o = h
l.y = b
a.u = b
a.z = b
a.p = c
a.q = l
a.s = h
g.u = b
g.p = c
g.q = l
g.z = a
g.s = h
assert h.p.y.p.o.p.y.txt == "b"