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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: D = None
        self.q: H = None
        self.o: A = None
        self.x: G = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: F = None
        self.o: H = None
        self.y: G = None
        self.q: F = None
        self.r: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: B = None
        self.s: C = None
        self.r: C = None
        self.txt = txt

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

f = A("f")
m = B("m")
c = C("c")
d = D("d")
l = E("l")
j = F("j")
n = G("n")
a = H("a")
i = I("i")

f.r = a
f.p = a
f.v = m
f.z = c
m.p = l
m.s = d
m.z = j
c.w = m
c.s = d
c.q = a
c.o = f
c.x = n
c.v = l
d.s = m
d.y = a
l.z = f
l.w = j
l.q = j
l.o = a
l.y = n
l.r = c
j.s = f
j.p = a
n.z = d
a.u = f
a.y = m
a.s = c
a.r = c
i.r = l
i.v = n
i.q = n
assert m.z.p.y.s.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: B = None
        self.p: H = None
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: D = None
        self.q: H = None
        self.o: A = None
        self.x: G = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: F = None
        self.o: H = None
        self.y: G = None
        self.q: F = None
        self.r: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: B = None
        self.s: C = None
        self.r: C = None
        self.txt = txt

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

f = A("f")
m = B("m")
c = C("c")
d = D("d")
l = E("l")
j = F("j")
n = G("n")
a = H("a")
i = I("i")

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