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

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.s: H = None
        self.y: I = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.r: F = None
        self.t: B = None
        self.s: B = None
        self.x: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: A = None
        self.v: F = None
        self.u: I = None
        self.s: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: G = None
        self.r: E = None
        self.v: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.s: H = None
        self.y: I = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.r: F = None
        self.t: B = None
        self.s: B = None
        self.x: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: A = None
        self.v: F = None
        self.u: I = None
        self.s: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: G = None
        self.r: E = None
        self.v: B = None
        self.txt = txt

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

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