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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: C = None
        self.o: G = None
        self.p: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: C = None
        self.x: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: A = None
        self.z: A = None
        self.r: C = None
        self.o: D = None
        self.y: C = None
        self.txt = txt

n = A("n")
f = B("f")
l = C("l")
k = D("k")
b = E("b")
d = F("d")
j = G("j")
e = D("e")
h = E("h")

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: C = None
        self.o: G = None
        self.p: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: C = None
        self.x: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: A = None
        self.z: A = None
        self.r: C = None
        self.o: D = None
        self.y: C = None
        self.txt = txt

n = A("n")
f = B("f")
l = C("l")
k = D("k")
b = E("b")
d = F("d")
j = G("j")
e = D("e")
h = E("h")

n.u = b
f.q = d
f.z = l
f.o = j
f.p = b
l.x = d
l.v = n
l.s = n
l.q = f
k.r = e
k.u = e
b.r = n
b.o = l
b.x = j
d.z = l
d.p = l
d.y = l
d.v = f
j.v = k
j.o = k
j.s = n
j.z = n
j.r = l
j.y = l
e.r = k
e.u = k
h.r = n
h.o = l
h.x = j
assert k.r.u.u.u.r.txt == "e"