class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: I = None
        self.r: C = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: D = None
        self.o: G = None
        self.s: G = None
        self.x: D = None
        self.z: H = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.y: D = None
        self.w: E = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: G = None
        self.p: I = None
        self.o: C = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: A = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

f.w = l
f.r = l
f.q = n
f.y = k
a.w = k
a.t = g
a.x = g
a.o = j
a.s = j
a.z = d
a.y = f
l.q = n
l.y = g
l.w = k
l.x = b
g.s = l
g.o = l
g.q = j
g.p = n
g.x = f
k.s = l
k.p = f
b.q = j
b.o = j
b.z = d
j.u = l
j.y = f
j.r = g
d.z = b
d.s = b
n.r = a
assert f.r.x.z.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: I = None
        self.r: C = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: D = None
        self.o: G = None
        self.s: G = None
        self.x: D = None
        self.z: H = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.y: D = None
        self.w: E = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: G = None
        self.p: I = None
        self.o: C = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: A = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

f.w = l
f.r = l
f.q = n
f.y = k
a.w = k
a.t = g
a.x = g
a.o = j
a.s = j
a.z = d
a.y = f
l.q = n
l.y = g
l.w = k
l.x = b
g.s = l
g.o = l
g.q = j
g.p = n
g.x = f
k.s = l
k.p = f
b.q = j
b.o = j
b.z = d
j.u = l
j.y = f
j.r = g
d.z = b
d.s = b
n.r = a
assert f.r.x.z.z.q.txt == "j"