class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

m = A("m")
l = B("l")
f = C("f")
a = D("a")
k = E("k")
i = F("i")
e = G("e")
g = C("g")

m.x = g
m.s = i
l.t = i
f.p = l
f.t = g
a.z = i
a.p = i
a.x = m
a.t = k
a.v = k
a.r = f
k.s = a
i.r = k
i.z = k
i.y = e
i.s = e
i.u = m
i.w = a
e.z = f
e.s = a
g.p = l
g.t = f
assert l.t.u.x.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

m = A("m")
l = B("l")
f = C("f")
a = D("a")
k = E("k")
i = F("i")
e = G("e")
g = C("g")

m.x = g
m.s = i
l.t = i
f.p = l
f.t = g
a.z = i
a.p = i
a.x = m
a.t = k
a.v = k
a.r = f
k.s = a
i.r = k
i.z = k
i.y = e
i.s = e
i.u = m
i.w = a
e.z = f
e.s = a
g.p = l
g.t = f
assert l.t.u.x.t.t.t.txt == "f"