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

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

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

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

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

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

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

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

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

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

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

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

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

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

n.t = b
h.y = l
h.x = c
l.u = c
l.y = h
l.v = g
g.z = k
g.p = l
k.q = d
k.s = c
k.v = g
f.t = l
f.u = b
f.z = h
f.x = c
f.v = g
d.y = l
d.x = n
c.t = k
m.t = l
m.u = k
m.z = d
m.x = c
m.v = g
b.q = d
b.s = c
b.v = g
assert h.x.t.v.z.s.t.txt == "k"