class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: G = None
        self.v: B = None
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: F = None
        self.p: E = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: D = None
        self.q: C = None
        self.s: B = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: G = None
        self.s: E = None
        self.z: B = None
        self.v: A = None
        self.txt = txt

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

e = A("e")
i = B("i")
l = C("l")
f = D("f")
m = E("m")
n = F("n")
c = G("c")
h = F("h")

e.x = f
e.y = c
e.v = i
e.w = m
i.s = m
l.u = i
l.q = i
l.v = i
l.x = i
l.z = h
l.p = h
f.z = e
f.w = n
f.p = m
f.s = i
m.o = f
m.y = f
m.r = f
m.q = l
m.s = i
n.o = l
n.u = c
n.s = m
n.z = i
n.v = e
c.u = i
h.o = l
h.u = c
h.s = m
h.z = i
h.v = e
assert l.x.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: G = None
        self.v: B = None
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: F = None
        self.p: E = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: D = None
        self.q: C = None
        self.s: B = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: G = None
        self.s: E = None
        self.z: B = None
        self.v: A = None
        self.txt = txt

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

e = A("e")
i = B("i")
l = C("l")
f = D("f")
m = E("m")
n = F("n")
c = G("c")
h = F("h")

e.x = f
e.y = c
e.v = i
e.w = m
i.s = m
l.u = i
l.q = i
l.v = i
l.x = i
l.z = h
l.p = h
f.z = e
f.w = n
f.p = m
f.s = i
m.o = f
m.y = f
m.r = f
m.q = l
m.s = i
n.o = l
n.u = c
n.s = m
n.z = i
n.v = e
c.u = i
h.o = l
h.u = c
h.s = m
h.z = i
h.v = e
assert l.x.s.r.txt == "f"