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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: F = None
        self.v: F = None
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: E = None
        self.x: E = None
        self.v: F = None
        self.w: F = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: C = None
        self.q: F = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: D = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: B = None
        self.w: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: F = None
        self.v: F = None
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: E = None
        self.x: E = None
        self.v: F = None
        self.w: F = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: C = None
        self.q: F = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: D = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: B = None
        self.w: G = None
        self.txt = txt

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

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

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