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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: H = None
        self.t: A = None
        self.w: D = None
        self.txt = txt

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

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

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

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

h.r = i
h.v = c
h.s = d
g.w = c
g.u = b
c.x = e
e.u = b
e.y = h
k.r = b
a.x = e
a.w = e
a.y = d
a.t = h
b.u = k
b.y = h
b.q = h
b.w = a
b.v = a
b.x = i
b.z = g
d.z = i
d.u = c
i.v = k
i.u = a
j.v = k
j.u = a
assert k.r.u.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: I = None
        self.v: C = None
        self.s: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: H = None
        self.t: A = None
        self.w: D = None
        self.txt = txt

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

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

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

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

h.r = i
h.v = c
h.s = d
g.w = c
g.u = b
c.x = e
e.u = b
e.y = h
k.r = b
a.x = e
a.w = e
a.y = d
a.t = h
b.u = k
b.y = h
b.q = h
b.w = a
b.v = a
b.x = i
b.z = g
d.z = i
d.u = c
i.v = k
i.u = a
j.v = k
j.u = a
assert k.r.u.r.u.txt == "k"