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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: E = None
        self.t: C = None
        self.q: D = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: F = None
        self.u: D = None
        self.q: E = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: G = None
        self.t: F = None
        self.z: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: E = None
        self.t: C = None
        self.q: D = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: F = None
        self.u: D = None
        self.q: E = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: G = None
        self.t: F = None
        self.z: F = None
        self.txt = txt

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

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

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

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