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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: G = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: D = None
        self.u: C = None
        self.z: B = None
        self.y: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: G = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: D = None
        self.u: C = None
        self.z: B = None
        self.y: D = None
        self.txt = txt

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

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

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