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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: B = 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.x: A = None
        self.z: A = None
        self.w: D = None
        self.p: G = None
        self.r: G = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: B = 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.x: A = None
        self.z: A = None
        self.w: D = None
        self.p: G = None
        self.r: G = None
        self.t: A = None
        self.txt = txt

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

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

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

m.x = f
m.r = f
m.t = l
m.p = b
g.w = c
a.v = g
a.o = g
b.s = f
c.x = m
c.z = m
c.t = m
c.w = b
c.p = f
c.r = f
l.r = g
l.x = f
l.v = f
l.u = a
l.q = a
f.r = i
i.x = m
i.z = m
i.t = m
i.w = b
i.p = f
i.r = f
assert l.q.o.w.w.s.txt == "f"