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

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

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

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

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

b = A("b")
d = B("d")
j = C("j")
g = D("g")
n = E("n")
c = A("c")
l = A("l")
f = B("f")

b.q = n
b.w = d
b.v = j
b.t = j
b.o = g
d.u = f
d.s = n
d.r = g
d.y = j
j.x = b
g.v = j
n.s = j
c.q = n
c.w = d
c.v = j
c.t = j
c.o = g
l.q = n
l.w = d
l.v = j
l.t = j
l.o = g
f.u = d
f.s = n
f.r = g
f.y = j
assert c.o.v.x.q.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: B = None
        self.v: C = None
        self.o: D = None
        self.t: C = None
        self.txt = txt

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

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

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

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

b = A("b")
d = B("d")
j = C("j")
g = D("g")
n = E("n")
c = A("c")
l = A("l")
f = B("f")

b.q = n
b.w = d
b.v = j
b.t = j
b.o = g
d.u = f
d.s = n
d.r = g
d.y = j
j.x = b
g.v = j
n.s = j
c.q = n
c.w = d
c.v = j
c.t = j
c.o = g
l.q = n
l.w = d
l.v = j
l.t = j
l.o = g
f.u = d
f.s = n
f.r = g
f.y = j
assert c.o.v.x.q.s.x.txt == "b"