class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.p: D = None
        self.z: A = None
        self.v: E = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: C = None
        self.q: C = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: A = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: C = None
        self.z: E = None
        self.txt = txt

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

k = A("k")
h = B("h")
f = C("f")
e = D("e")
n = E("n")
i = F("i")
m = E("m")
j = E("j")
b = A("b")
g = D("g")

k.u = h
k.w = h
k.p = g
k.z = b
k.v = n
k.y = n
h.s = g
h.t = f
h.q = f
h.o = e
f.u = b
f.z = b
f.o = h
e.s = h
e.u = h
n.u = k
n.y = f
n.z = j
i.s = g
i.z = j
m.u = k
m.y = f
m.z = j
j.u = k
j.y = f
j.z = n
b.u = h
b.w = h
b.p = e
b.z = k
b.v = n
b.y = j
g.s = h
g.u = h
assert f.o.o.s.s.s.t.u.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.p: D = None
        self.z: A = None
        self.v: E = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: C = None
        self.q: C = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: A = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: C = None
        self.z: E = None
        self.txt = txt

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

k = A("k")
h = B("h")
f = C("f")
e = D("e")
n = E("n")
i = F("i")
m = E("m")
j = E("j")
b = A("b")
g = D("g")

k.u = h
k.w = h
k.p = g
k.z = b
k.v = n
k.y = n
h.s = g
h.t = f
h.q = f
h.o = e
f.u = b
f.z = b
f.o = h
e.s = h
e.u = h
n.u = k
n.y = f
n.z = j
i.s = g
i.z = j
m.u = k
m.y = f
m.z = j
j.u = k
j.y = f
j.z = n
b.u = h
b.w = h
b.p = e
b.z = k
b.v = n
b.y = j
g.s = h
g.u = h
assert f.o.o.s.s.s.t.u.z.p.txt == "g"