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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: F = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: B = None
        self.r: D = None
        self.o: C = None
        self.v: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: F = None
        self.y: D = None
        self.s: F = None
        self.p: D = None
        self.w: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: F = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: B = None
        self.r: D = None
        self.o: C = None
        self.v: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: F = None
        self.y: D = None
        self.s: F = None
        self.p: D = None
        self.w: C = None
        self.txt = txt

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

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