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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: A = None
        self.txt = txt

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

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

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

g.w = j
g.o = i
g.x = b
g.y = k
c.o = m
c.u = n
c.z = g
b.q = j
b.v = g
j.s = b
j.y = b
m.z = n
m.s = j
m.x = c
m.u = c
e.w = j
e.o = i
e.x = k
e.y = b
i.w = j
i.o = e
i.x = k
i.y = b
k.q = n
k.v = g
n.s = b
n.y = b
l.z = j
l.s = j
l.x = c
l.u = c
assert l.x.u.y.q.s.q.y.q.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: A = None
        self.x: C = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: A = None
        self.txt = txt

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

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

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

g.w = j
g.o = i
g.x = b
g.y = k
c.o = m
c.u = n
c.z = g
b.q = j
b.v = g
j.s = b
j.y = b
m.z = n
m.s = j
m.x = c
m.u = c
e.w = j
e.o = i
e.x = k
e.y = b
i.w = j
i.o = e
i.x = k
i.y = b
k.q = n
k.v = g
n.s = b
n.y = b
l.z = j
l.s = j
l.x = c
l.u = c
assert l.x.u.y.q.s.q.y.q.s.v.txt == "g"