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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: C = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: F = None
        self.v: A = None
        self.z: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: B = None
        self.s: B = None
        self.t: G = None
        self.y: C = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: E = None
        self.s: B = None
        self.o: B = None
        self.t: A = None
        self.q: E = None
        self.p: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: C = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: F = None
        self.v: A = None
        self.z: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: B = None
        self.s: B = None
        self.t: G = None
        self.y: C = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: E = None
        self.s: B = None
        self.o: B = None
        self.t: A = None
        self.q: E = None
        self.p: E = None
        self.txt = txt

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

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