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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: C = None
        self.y: B = None
        self.u: C = None
        self.t: C = None
        self.txt = txt

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

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

g = A("g")
l = B("l")
f = C("f")
m = D("m")
k = E("k")
c = C("c")
j = A("j")
d = E("d")
i = B("i")

g.o = f
l.r = k
l.s = i
l.u = i
l.p = d
l.q = f
f.p = l
f.z = c
f.u = c
f.t = c
f.y = i
m.y = d
m.p = c
k.r = i
c.p = l
c.y = l
c.z = f
c.u = f
c.t = f
j.o = f
d.r = l
i.r = k
i.p = k
i.s = l
i.u = l
i.q = c
assert k.r.u.s.q.y.s.q.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: C = None
        self.y: B = None
        self.u: C = None
        self.t: C = None
        self.txt = txt

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

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

g = A("g")
l = B("l")
f = C("f")
m = D("m")
k = E("k")
c = C("c")
j = A("j")
d = E("d")
i = B("i")

g.o = f
l.r = k
l.s = i
l.u = i
l.p = d
l.q = f
f.p = l
f.z = c
f.u = c
f.t = c
f.y = i
m.y = d
m.p = c
k.r = i
c.p = l
c.y = l
c.z = f
c.u = f
c.t = f
j.o = f
d.r = l
i.r = k
i.p = k
i.s = l
i.u = l
i.q = c
assert k.r.u.s.q.y.s.q.t.t.txt == "c"