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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: G = None
        self.p: A = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: D = None
        self.r: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: H = None
        self.p: D = None
        self.r: H = None
        self.t: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: G = None
        self.p: A = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: D = None
        self.r: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: H = None
        self.p: D = None
        self.r: H = None
        self.t: E = None
        self.txt = txt

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

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