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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: A = None
        self.r: A = None
        self.q: A = None
        self.o: A = None
        self.u: F = None
        self.v: C = None
        self.txt = txt

a = A("a")
j = B("j")
b = C("b")
l = D("l")
c = E("c")
g = F("g")
m = G("m")

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: A = None
        self.r: A = None
        self.q: A = None
        self.o: A = None
        self.u: F = None
        self.v: C = None
        self.txt = txt

a = A("a")
j = B("j")
b = C("b")
l = D("l")
c = E("c")
g = F("g")
m = G("m")

a.s = j
a.y = b
a.o = c
j.y = l
j.r = l
j.w = l
b.o = g
b.r = m
b.v = a
l.p = b
l.s = a
l.v = a
l.w = c
l.z = c
c.t = g
g.s = b
g.t = l
g.w = l
g.z = m
g.o = c
g.v = c
m.p = b
m.v = b
m.t = a
m.r = a
m.q = a
m.o = a
m.u = g
assert c.t.v.t.v.t.txt == "g"