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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

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

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

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

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

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