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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: G = None
        self.r: G = None
        self.x: G = None
        self.y: F = None
        self.txt = txt

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

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

a = A("a")
b = B("b")
k = C("k")
f = D("f")
d = E("d")
m = F("m")
l = G("l")

a.z = f
a.y = f
a.o = f
a.p = l
a.u = b
b.w = m
k.y = b
k.o = l
k.v = l
k.q = f
k.r = m
f.t = m
f.v = m
f.p = m
f.w = k
d.s = k
d.p = l
d.r = l
d.x = l
d.y = m
m.w = k
m.o = l
m.v = b
l.x = f
l.p = f
l.y = f
l.s = d
l.q = m
assert a.u.w.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: G = None
        self.y: D = None
        self.u: B = None
        self.o: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: G = None
        self.r: G = None
        self.x: G = None
        self.y: F = None
        self.txt = txt

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

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

a = A("a")
b = B("b")
k = C("k")
f = D("f")
d = E("d")
m = F("m")
l = G("l")

a.z = f
a.y = f
a.o = f
a.p = l
a.u = b
b.w = m
k.y = b
k.o = l
k.v = l
k.q = f
k.r = m
f.t = m
f.v = m
f.p = m
f.w = k
d.s = k
d.p = l
d.r = l
d.x = l
d.y = m
m.w = k
m.o = l
m.v = b
l.x = f
l.p = f
l.y = f
l.s = d
l.q = m
assert a.u.w.v.w.txt == "m"