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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: C = None
        self.r: B = None
        self.w: B = None
        self.u: D = None
        self.txt = txt

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

l = A("l")
g = B("g")
h = C("h")
f = D("f")
k = E("k")
n = C("n")
c = D("c")
m = A("m")

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: C = None
        self.r: B = None
        self.w: B = None
        self.u: D = None
        self.txt = txt

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

l = A("l")
g = B("g")
h = C("h")
f = D("f")
k = E("k")
n = C("n")
c = D("c")
m = A("m")

l.t = c
l.u = f
l.r = f
l.z = n
l.x = g
g.t = n
g.o = f
g.p = h
h.q = g
f.v = h
f.y = h
f.r = g
f.w = g
f.u = c
k.w = f
n.q = g
c.v = h
c.y = n
c.r = g
c.w = g
c.u = f
m.t = c
m.u = c
m.r = c
m.z = h
m.x = g
assert k.w.u.w.o.y.q.txt == "g"