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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: G = None
        self.t: G = None
        self.w: B = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: G = None
        self.t: G = None
        self.w: B = None
        self.s: D = None
        self.txt = txt

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

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

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