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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: F = None
        self.x: C = None
        self.p: D = None
        self.v: F = None
        self.r: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: F = None
        self.x: C = None
        self.p: D = None
        self.v: F = None
        self.r: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: A = None
        self.txt = txt

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

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