class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: C = None
        self.t: G = None
        self.r: C = None
        self.p: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: I = None
        self.u: A = None
        self.y: G = None
        self.v: I = None
        self.x: B = None
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: F = None
        self.p: H = None
        self.w: H = None
        self.x: H = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: E = None
        self.q: A = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: D = None
        self.u: E = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: I = None
        self.u: A = None
        self.y: G = None
        self.v: I = None
        self.x: B = None
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: F = None
        self.p: H = None
        self.w: H = None
        self.x: H = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: E = None
        self.q: A = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: D = None
        self.u: E = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: A = None
        self.txt = txt

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

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

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