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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: B = None
        self.w: A = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: B = None
        self.w: A = None
        self.z: D = None
        self.txt = txt

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

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

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

a.y = j
b.r = i
b.p = a
b.z = c
b.x = c
b.w = j
j.s = l
j.t = b
j.w = i
j.z = e
e.o = j
e.y = l
e.u = b
m.v = c
d.v = m
i.y = j
c.v = d
l.o = j
l.y = e
l.u = b
g.y = j
assert i.y.z.y.u.w.txt == "j"