class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: D = None
        self.o: H = None
        self.s: F = None
        self.v: E = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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