class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: F = None
        self.u: B = None
        self.r: B = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: D = None
        self.u: E = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: D = None
        self.y: F = None
        self.w: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: F = None
        self.u: B = None
        self.r: B = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: D = None
        self.u: E = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: D = None
        self.y: F = None
        self.w: E = None
        self.txt = txt

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

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

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