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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: B = None
        self.txt = txt

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

i.t = b
i.x = m
i.v = g
f.v = j
f.p = j
f.q = b
f.t = b
f.w = l
j.q = b
j.t = i
j.r = i
j.o = c
d.w = i
d.r = f
c.z = g
c.q = l
b.w = i
b.r = n
l.v = j
l.p = j
l.q = b
l.w = f
l.t = d
m.q = d
m.t = i
m.r = i
m.o = g
n.v = m
n.p = m
n.q = d
n.w = l
n.t = b
g.z = c
g.q = n
assert g.q.v.o.z.q.txt == "l"