class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: H = None
        self.t: I = None
        self.p: G = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: E = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: G = None
        self.r: I = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: E = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: G = None
        self.r: I = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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