class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: F = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: B = None
        self.r: C = None
        self.v: C = None
        self.o: D = None
        self.x: G = None
        self.p: G = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: B = None
        self.r: C = None
        self.v: C = None
        self.o: D = None
        self.x: G = None
        self.p: G = None
        self.txt = txt

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

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

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