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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: C = None
        self.t: D = None
        self.q: C = None
        self.x: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: B = None
        self.o: B = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: C = None
        self.s: A = None
        self.z: F = None
        self.p: D = None
        self.q: D = None
        self.txt = txt

f = A("f")
e = B("e")
n = C("n")
l = D("l")
a = E("a")
k = F("k")
b = C("b")
j = F("j")
h = E("h")

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: C = None
        self.t: D = None
        self.q: C = None
        self.x: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: B = None
        self.o: B = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: C = None
        self.s: A = None
        self.z: F = None
        self.p: D = None
        self.q: D = None
        self.txt = txt

f = A("f")
e = B("e")
n = C("n")
l = D("l")
a = E("a")
k = F("k")
b = C("b")
j = F("j")
h = E("h")

f.v = h
e.r = k
e.w = n
e.t = l
e.q = b
e.x = a
n.z = h
n.y = b
l.q = k
a.r = k
a.p = k
a.t = e
a.o = e
k.x = e
k.y = b
k.s = f
k.z = j
k.p = l
k.q = l
b.z = a
b.y = n
j.x = e
j.y = b
j.s = f
j.z = k
j.p = l
j.q = l
h.r = j
h.t = e
h.o = e
h.p = k
assert a.p.q.q.x.q.y.txt == "n"