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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: C = None
        self.z: C = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: B = None
        self.w: C = None
        self.s: B = None
        self.q: G = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: E = None
        self.q: B = None
        self.y: A = None
        self.x: D = None
        self.w: D = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: C = None
        self.z: C = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: B = None
        self.w: C = None
        self.s: B = None
        self.q: G = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: E = None
        self.q: B = None
        self.y: A = None
        self.x: D = None
        self.w: D = None
        self.p: A = None
        self.txt = txt

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

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