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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: A = None
        self.x: E = None
        self.q: E = None
        self.z: F = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: D = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: A = None
        self.x: E = None
        self.q: E = None
        self.z: F = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: D = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

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

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