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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: C = None
        self.x: D = None
        self.s: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: E = None
        self.o: I = None
        self.t: I = None
        self.p: B = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: B = None
        self.q: H = None
        self.s: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: H = None
        self.w: F = None
        self.o: A = None
        self.z: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: D = None
        self.p: D = None
        self.t: I = None
        self.q: F = None
        self.txt = txt

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

f = A("f")
m = B("m")
b = C("b")
n = D("n")
h = E("h")
l = F("l")
j = G("j")
k = H("k")
d = I("d")

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: C = None
        self.x: D = None
        self.s: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: E = None
        self.o: I = None
        self.t: I = None
        self.p: B = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: B = None
        self.q: H = None
        self.s: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: H = None
        self.w: F = None
        self.o: A = None
        self.z: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: D = None
        self.p: D = None
        self.t: I = None
        self.q: F = None
        self.txt = txt

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

f = A("f")
m = B("m")
b = C("b")
n = D("n")
h = E("h")
l = F("l")
j = G("j")
k = H("k")
d = I("d")

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