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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: D = None
        self.q: A = None
        self.s: G = None
        self.p: F = None
        self.x: A = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: F = None
        self.w: G = None
        self.r: G = None
        self.o: C = None
        self.q: D = None
        self.z: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: D = None
        self.q: A = None
        self.s: G = None
        self.p: F = None
        self.x: A = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: F = None
        self.w: G = None
        self.r: G = None
        self.o: C = None
        self.q: D = None
        self.z: D = None
        self.txt = txt

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

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

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

k.r = e
k.x = d
e.t = l
e.s = l
e.y = m
e.q = k
e.x = k
e.p = d
e.u = d
b.p = d
b.t = m
m.o = e
m.w = e
m.z = e
m.r = k
m.s = b
f.t = l
f.w = l
f.r = l
f.u = d
f.o = b
f.q = m
f.z = m
d.u = e
d.q = m
d.r = f
l.r = k
l.u = k
l.z = k
l.q = b
l.p = f
l.w = f
assert k.x.u.q.x.u.p.txt == "d"