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

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

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

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

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

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

h = A("h")
j = B("j")
k = C("k")
m = D("m")
i = E("i")
n = F("n")
g = A("g")
b = B("b")

h.u = k
h.s = g
j.z = k
k.s = h
k.o = j
k.r = i
k.t = i
k.z = m
k.x = g
m.u = i
m.p = b
m.v = n
m.w = n
m.s = n
m.t = h
i.y = n
i.u = b
n.p = g
n.x = g
n.z = k
g.u = k
g.s = h
b.z = k
assert b.z.t.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: A = None
        self.txt = txt

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

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

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

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

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

h = A("h")
j = B("j")
k = C("k")
m = D("m")
i = E("i")
n = F("n")
g = A("g")
b = B("b")

h.u = k
h.s = g
j.z = k
k.s = h
k.o = j
k.r = i
k.t = i
k.z = m
k.x = g
m.u = i
m.p = b
m.v = n
m.w = n
m.s = n
m.t = h
i.y = n
i.u = b
n.p = g
n.x = g
n.z = k
g.u = k
g.s = h
b.z = k
assert b.z.t.u.z.txt == "k"