class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: D = None
        self.s: C = None
        self.q: F = None
        self.z: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: A = None
        self.s: H = None
        self.o: B = None
        self.q: B = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.v: I = None
        self.o: D = None
        self.q: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: C = None
        self.y: F = None
        self.v: I = None
        self.z: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: F = None
        self.r: G = None
        self.u: G = None
        self.s: F = None
        self.txt = txt

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

f.p = h
f.x = d
f.s = b
f.q = a
f.z = k
c.u = l
c.w = b
c.x = b
c.y = f
b.p = c
b.r = f
b.s = l
b.o = e
b.x = h
b.w = d
d.w = e
h.r = d
h.t = f
h.s = k
h.o = c
h.q = c
h.w = a
a.z = l
a.v = l
a.o = d
a.q = f
e.t = a
e.u = a
k.r = a
k.y = a
k.p = b
k.v = l
k.z = l
l.q = c
l.x = a
l.s = a
l.r = e
l.u = e
assert f.q.o.w.t.q.q.q.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: D = None
        self.s: C = None
        self.q: F = None
        self.z: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: A = None
        self.s: H = None
        self.o: B = None
        self.q: B = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.v: I = None
        self.o: D = None
        self.q: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: C = None
        self.y: F = None
        self.v: I = None
        self.z: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: F = None
        self.r: G = None
        self.u: G = None
        self.s: F = None
        self.txt = txt

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

f.p = h
f.x = d
f.s = b
f.q = a
f.z = k
c.u = l
c.w = b
c.x = b
c.y = f
b.p = c
b.r = f
b.s = l
b.o = e
b.x = h
b.w = d
d.w = e
h.r = d
h.t = f
h.s = k
h.o = c
h.q = c
h.w = a
a.z = l
a.v = l
a.o = d
a.q = f
e.t = a
e.u = a
k.r = a
k.y = a
k.p = b
k.v = l
k.z = l
l.q = c
l.x = a
l.s = a
l.r = e
l.u = e
assert f.q.o.w.t.q.q.q.z.p.txt == "b"