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

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

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

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

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

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

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

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

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

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

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

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

b.t = d
f.p = i
f.u = d
f.t = m
f.y = g
i.q = b
i.o = j
i.r = g
d.v = m
d.w = i
d.o = i
j.y = a
j.z = i
j.o = l
a.v = m
a.w = k
a.o = i
l.t = d
k.q = b
k.o = g
k.r = j
m.p = i
m.u = d
m.t = f
m.y = g
g.y = a
g.z = k
g.o = l
assert j.y.o.r.o.t.w.q.txt == "b"