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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: B = None
        self.v: C = None
        self.t: E = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: B = None
        self.v: C = None
        self.t: E = None
        self.p: B = None
        self.txt = txt

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

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

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

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