class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: C = None
        self.s: B = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: B = None
        self.x: A = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: B = None
        self.x: A = None
        self.t: C = None
        self.txt = txt

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

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

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