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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: G = None
        self.x: C = None
        self.o: B = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: C = None
        self.q: D = None
        self.u: C = None
        self.txt = txt

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

n.u = l
n.o = g
n.p = k
n.x = j
n.r = j
k.w = l
k.s = l
k.r = l
k.t = g
k.v = g
k.q = j
k.p = b
b.o = k
b.u = l
l.r = b
l.t = b
l.v = b
l.y = g
j.y = n
j.p = g
j.u = k
j.r = f
g.s = b
g.x = b
g.u = f
g.o = k
g.r = j
f.z = j
f.p = b
f.u = b
f.q = l
assert l.y.o.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: F = None
        self.p: B = None
        self.x: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: G = None
        self.x: C = None
        self.o: B = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: C = None
        self.q: D = None
        self.u: C = None
        self.txt = txt

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

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