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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: G = None
        self.o: F = None
        self.y: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: G = None
        self.o: F = None
        self.y: A = None
        self.txt = txt

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

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

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

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