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

class B:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: F = None
        self.y: F = None
        self.s: A = None
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: H = None
        self.p: D = None
        self.s: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: F = None
        self.r: G = None
        self.o: B = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.t: C = None
        self.y: F = None
        self.q: E = None
        self.p: D = None
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: C = None
        self.z: D = None
        self.s: I = None
        self.x: I = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: F = None
        self.y: F = None
        self.s: A = None
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: H = None
        self.p: D = None
        self.s: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: F = None
        self.r: G = None
        self.o: B = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.t: C = None
        self.y: F = None
        self.q: E = None
        self.p: D = None
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: C = None
        self.z: D = None
        self.s: I = None
        self.x: I = None
        self.txt = txt

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

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

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