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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: E = None
        self.p: F = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: H = None
        self.w: D = None
        self.r: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: D = None
        self.p: B = None
        self.txt = txt

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

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

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

l.r = g
l.s = g
l.p = h
l.q = k
l.t = m
l.o = n
l.x = f
f.z = d
f.s = h
f.p = n
f.v = l
k.z = f
k.t = d
k.w = c
k.r = n
c.o = d
c.x = d
c.q = g
c.p = n
h.u = g
n.q = f
n.p = f
n.w = c
g.s = l
g.q = m
g.p = i
g.x = d
g.y = f
g.w = n
d.u = h
m.o = d
m.x = d
m.q = i
m.p = n
i.s = l
i.q = m
i.p = g
i.x = d
i.y = f
i.w = n
assert m.p.q.z.u.u.w.q.s.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: E = None
        self.q: C = None
        self.t: D = None
        self.s: G = None
        self.o: F = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: E = None
        self.p: F = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: H = None
        self.w: D = None
        self.r: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: D = None
        self.p: B = None
        self.txt = txt

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

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

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

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