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

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: D = None
        self.v: G = None
        self.w: C = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: G = None
        self.q: C = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: E = None
        self.v: F = None
        self.r: H = None
        self.t: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: D = None
        self.v: G = None
        self.w: C = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: G = None
        self.q: C = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: E = None
        self.v: F = None
        self.r: H = None
        self.t: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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