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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: F = None
        self.w: C = None
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: G = None
        self.z: E = None
        self.x: D = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: F = None
        self.w: C = None
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: G = None
        self.z: E = None
        self.x: D = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: E = None
        self.txt = txt

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

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