class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: H = None
        self.x: D = None
        self.v: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: B = None
        self.s: C = None
        self.o: H = None
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

b = A("b")
n = B("n")
g = C("g")
h = D("h")
d = E("d")
f = F("f")
k = G("k")
a = H("a")

b.p = n
b.z = a
b.x = h
b.v = k
n.v = h
n.r = f
g.v = h
g.z = h
g.y = n
g.t = b
h.q = d
h.t = b
h.u = k
d.z = g
d.t = g
d.s = g
d.w = b
d.r = h
f.u = k
f.p = k
f.y = n
f.s = g
f.o = a
k.u = h
a.o = f
assert f.u.u.t.x.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: H = None
        self.x: D = None
        self.v: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: B = None
        self.s: C = None
        self.o: H = None
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

b = A("b")
n = B("n")
g = C("g")
h = D("h")
d = E("d")
f = F("f")
k = G("k")
a = H("a")

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