class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: H = None
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: H = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: D = None
        self.w: F = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: B = None
        self.o: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: H = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: D = None
        self.w: F = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: B = None
        self.o: D = None
        self.txt = txt

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

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

f.q = i
f.w = m
f.u = n
b.y = j
b.t = c
c.y = f
c.v = f
c.p = n
j.t = n
i.y = j
i.p = c
i.r = l
k.u = f
k.p = f
k.q = m
n.q = f
n.v = f
n.s = j
n.w = k
m.y = k
m.p = d
m.o = j
l.t = j
l.s = b
l.w = f
l.p = n
l.x = d
d.y = j
d.t = c
assert d.y.t.q.q.y.t.s.t.s.t.txt == "n"