class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: C = None
        self.u: G = None
        self.y: C = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: E = None
        self.y: A = None
        self.z: D = None
        self.p: A = None
        self.txt = txt

c = A("c")
a = B("a")
i = C("i")
d = D("d")
f = E("f")
k = F("k")
h = G("h")
j = G("j")

c.w = i
c.p = d
a.v = d
a.o = c
a.z = j
a.w = k
i.s = f
i.p = c
d.p = f
d.y = a
f.v = a
f.x = k
f.t = k
k.w = c
k.o = i
k.y = i
k.u = j
k.p = a
h.u = d
h.z = d
h.x = f
h.y = c
h.p = c
j.u = d
j.z = d
j.x = f
j.y = c
j.p = c
assert a.w.u.u.p.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: C = None
        self.u: G = None
        self.y: C = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: E = None
        self.y: A = None
        self.z: D = None
        self.p: A = None
        self.txt = txt

c = A("c")
a = B("a")
i = C("i")
d = D("d")
f = E("f")
k = F("k")
h = G("h")
j = G("j")

c.w = i
c.p = d
a.v = d
a.o = c
a.z = j
a.w = k
i.s = f
i.p = c
d.p = f
d.y = a
f.v = a
f.x = k
f.t = k
k.w = c
k.o = i
k.y = i
k.u = j
k.p = a
h.u = d
h.z = d
h.x = f
h.y = c
h.p = c
j.u = d
j.z = d
j.x = f
j.y = c
j.p = c
assert a.w.u.u.p.x.y.txt == "i"