class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: F = None
        self.r: B = None
        self.p: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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