class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: E = None
        self.y: D = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: A = None
        self.t: G = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

b.u = m
b.t = m
b.s = a
b.y = k
l.y = m
l.q = m
i.o = k
i.u = b
i.t = d
i.z = m
k.y = d
a.w = i
m.r = l
m.w = l
m.u = i
d.w = a
assert m.u.t.w.w.u.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: E = None
        self.y: D = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: A = None
        self.t: G = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

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