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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: E = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: C = None
        self.o: F = None
        self.v: B = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: A = None
        self.o: D = None
        self.y: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: E = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: C = None
        self.o: F = None
        self.v: B = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: A = None
        self.o: D = None
        self.y: A = None
        self.txt = txt

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

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

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