class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: E = None
        self.v: D = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: I = None
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: G = None
        self.r: I = None
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: D = None
        self.z: E = None
        self.v: E = None
        self.o: E = None
        self.p: H = None
        self.q: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: I = None
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: G = None
        self.r: I = None
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: D = None
        self.z: E = None
        self.v: E = None
        self.o: E = None
        self.p: H = None
        self.q: A = None
        self.txt = txt

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

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