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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: E = None
        self.u: H = None
        self.s: B = None
        self.p: E = None
        self.r: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: H = None
        self.o: H = None
        self.u: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: F = None
        self.o: C = None
        self.x: D = None
        self.w: H = None
        self.s: H = None
        self.txt = txt

m = A("m")
e = B("e")
i = C("i")
b = D("b")
g = E("g")
n = F("n")
c = G("c")
f = H("f")
d = I("d")
l = J("l")

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: E = None
        self.u: H = None
        self.s: B = None
        self.p: E = None
        self.r: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: H = None
        self.o: H = None
        self.u: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: F = None
        self.o: C = None
        self.x: D = None
        self.w: H = None
        self.s: H = None
        self.txt = txt

m = A("m")
e = B("e")
i = C("i")
b = D("b")
g = E("g")
n = F("n")
c = G("c")
f = H("f")
d = I("d")
l = J("l")

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