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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: A = None
        self.y: I = None
        self.z: A = None
        self.o: D = None
        self.x: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: G = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: G = None
        self.w: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: G = None
        self.u: C = None
        self.y: F = None
        self.t: D = None
        self.x: G = None
        self.p: B = None
        self.s: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: D = None
        self.s: B = None
        self.u: A = None
        self.z: A = None
        self.p: C = None
        self.t: G = None
        self.q: E = None
        self.o: F = None
        self.v: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: I = None
        self.p: A = None
        self.t: C = None
        self.txt = txt

f = A("f")
g = B("g")
m = C("m")
k = D("k")
b = E("b")
l = F("l")
a = G("a")
c = H("c")
h = I("h")
j = J("j")

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: A = None
        self.y: I = None
        self.z: A = None
        self.o: D = None
        self.x: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: G = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: G = None
        self.w: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: G = None
        self.u: C = None
        self.y: F = None
        self.t: D = None
        self.x: G = None
        self.p: B = None
        self.s: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: D = None
        self.s: B = None
        self.u: A = None
        self.z: A = None
        self.p: C = None
        self.t: G = None
        self.q: E = None
        self.o: F = None
        self.v: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: I = None
        self.p: A = None
        self.t: C = None
        self.txt = txt

f = A("f")
g = B("g")
m = C("m")
k = D("k")
b = E("b")
l = F("l")
a = G("a")
c = H("c")
h = I("h")
j = J("j")

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