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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: A = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: B = None
        self.o: E = None
        self.w: C = None
        self.r: E = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: A = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: B = None
        self.o: E = None
        self.w: C = None
        self.r: E = None
        self.y: C = None
        self.txt = txt

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

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