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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: C = None
        self.q: A = None
        self.u: B = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: D = None
        self.q: B = None
        self.o: D = None
        self.x: D = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: C = None
        self.txt = txt

a = A("a")
j = B("j")
d = C("d")
n = D("n")
f = E("f")
m = F("m")
k = A("k")
e = B("e")

a.v = e
a.w = n
a.t = j
j.t = m
j.x = d
j.q = k
j.u = e
d.z = f
d.q = n
d.y = k
n.r = e
f.p = e
f.q = e
f.u = n
f.o = n
f.x = n
f.w = j
m.u = e
m.y = d
k.v = j
k.w = n
k.t = e
e.t = m
e.x = d
e.q = a
e.u = j
assert e.t.y.q.r.x.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: D = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: C = None
        self.q: A = None
        self.u: B = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: D = None
        self.q: B = None
        self.o: D = None
        self.x: D = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: C = None
        self.txt = txt

a = A("a")
j = B("j")
d = C("d")
n = D("n")
f = E("f")
m = F("m")
k = A("k")
e = B("e")

a.v = e
a.w = n
a.t = j
j.t = m
j.x = d
j.q = k
j.u = e
d.z = f
d.q = n
d.y = k
n.r = e
f.p = e
f.q = e
f.u = n
f.o = n
f.x = n
f.w = j
m.u = e
m.y = d
k.v = j
k.w = n
k.t = e
e.t = m
e.x = d
e.q = a
e.u = j
assert e.t.y.q.r.x.z.p.txt == "e"