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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: A = None
        self.txt = txt

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

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