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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: A = None
        self.p: C = None
        self.y: G = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: E = None
        self.p: C = None
        self.v: A = None
        self.q: D = None
        self.s: A = None
        self.z: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: A = None
        self.p: C = None
        self.y: G = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: E = None
        self.p: C = None
        self.v: A = None
        self.q: D = None
        self.s: A = None
        self.z: D = None
        self.txt = txt

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

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

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