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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: F = None
        self.z: G = None
        self.u: E = None
        self.o: B = None
        self.txt = txt

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

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

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

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

n.u = d
n.y = b
n.w = e
k.o = c
k.u = d
k.r = n
d.r = n
d.p = n
d.w = e
d.z = b
d.o = c
f.t = b
f.u = b
f.y = c
f.z = e
f.o = k
b.x = k
b.w = e
b.p = e
b.q = d
b.y = c
c.y = k
c.q = d
c.t = d
c.x = b
c.o = e
e.x = b
e.r = k
e.w = d
e.s = d
e.q = c
assert e.w.z.y.x.x.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: E = None
        self.w: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: F = None
        self.z: G = None
        self.u: E = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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