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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: A = None
        self.w: D = None
        self.o: A = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: A = None
        self.q: A = None
        self.x: E = None
        self.o: D = None
        self.y: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: A = None
        self.w: D = None
        self.o: A = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: A = None
        self.q: A = None
        self.x: E = None
        self.o: D = None
        self.y: C = None
        self.txt = txt

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

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

m.u = d
d.v = m
d.w = m
d.z = n
d.t = n
d.y = e
d.r = b
d.p = b
b.o = g
b.p = g
l.r = d
l.x = g
l.z = g
l.y = e
g.t = e
g.y = m
g.o = m
g.w = l
g.r = l
e.w = m
e.u = m
e.q = m
e.x = g
e.o = l
e.y = b
n.u = l
n.x = e
n.o = g
assert g.w.r.r.o.o.u.y.txt == "e"