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

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: B = None
        self.q: B = None
        self.txt = txt

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

m = A("m")
d = B("d")
i = C("i")
g = D("g")
h = E("h")
f = F("f")
b = G("b")
c = C("c")
k = B("k")
l = D("l")

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: B = None
        self.q: B = None
        self.txt = txt

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

m = A("m")
d = B("d")
i = C("i")
g = D("g")
h = E("h")
f = F("f")
b = G("b")
c = C("c")
k = B("k")
l = D("l")

m.y = c
m.v = l
m.t = h
d.s = i
d.y = l
d.u = l
d.p = b
d.x = b
d.q = f
i.w = c
g.z = h
h.o = i
f.p = b
f.y = d
f.q = d
b.w = k
b.q = h
b.z = g
c.w = i
k.s = i
k.y = l
k.u = l
k.p = b
k.x = b
k.q = f
l.z = h
assert c.w.w.w.txt == "i"