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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: E = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: E = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: A = None
        self.txt = txt

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

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