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

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: F = None
        self.z: C = None
        self.o: A = None
        self.r: C = None
        self.w: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: F = None
        self.q: B = None
        self.p: B = None
        self.z: I = None
        self.x: A = None
        self.y: F = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: G = None
        self.y: B = None
        self.o: H = None
        self.w: C = None
        self.txt = txt

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

f.q = n
f.u = b
i.p = a
i.u = c
n.y = j
c.x = g
c.u = i
a.x = f
a.o = f
a.y = g
a.z = n
a.r = n
a.w = n
g.s = a
m.z = b
m.s = n
b.w = c
b.s = g
b.y = g
b.q = i
b.p = i
b.z = j
b.o = j
b.x = f
j.t = f
j.x = m
j.y = i
j.o = b
j.w = n
assert f.u.o.t.q.y.o.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: F = None
        self.z: C = None
        self.o: A = None
        self.r: C = None
        self.w: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: F = None
        self.q: B = None
        self.p: B = None
        self.z: I = None
        self.x: A = None
        self.y: F = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: G = None
        self.y: B = None
        self.o: H = None
        self.w: C = None
        self.txt = txt

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

f.q = n
f.u = b
i.p = a
i.u = c
n.y = j
c.x = g
c.u = i
a.x = f
a.o = f
a.y = g
a.z = n
a.r = n
a.w = n
g.s = a
m.z = b
m.s = n
b.w = c
b.s = g
b.y = g
b.q = i
b.p = i
b.z = j
b.o = j
b.x = f
j.t = f
j.x = m
j.y = i
j.o = b
j.w = n
assert f.u.o.t.q.y.o.q.u.txt == "c"