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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: E = None
        self.w: C = None
        self.p: D = None
        self.u: A = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: G = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: E = None
        self.w: C = None
        self.p: D = None
        self.u: A = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: G = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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