class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: E = None
        self.u: C = None
        self.w: E = None
        self.p: E = None
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: D = None
        self.t: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: F = None
        self.q: F = None
        self.y: E = None
        self.txt = txt

h = A("h")
e = B("e")
c = C("c")
f = D("f")
n = E("n")
k = F("k")
a = F("a")
b = E("b")
g = F("g")

h.t = c
h.u = c
h.o = c
h.x = n
h.w = n
h.p = b
e.v = h
c.p = h
c.x = f
c.t = f
f.u = e
f.v = c
f.o = b
n.u = k
n.o = f
k.s = e
k.v = a
k.q = g
k.y = b
a.s = e
a.v = g
a.q = g
a.y = b
b.u = g
b.o = f
g.s = e
g.v = k
g.q = k
g.y = n
assert k.q.s.v.p.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: E = None
        self.u: C = None
        self.w: E = None
        self.p: E = None
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: D = None
        self.t: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: F = None
        self.q: F = None
        self.y: E = None
        self.txt = txt

h = A("h")
e = B("e")
c = C("c")
f = D("f")
n = E("n")
k = F("k")
a = F("a")
b = E("b")
g = F("g")

h.t = c
h.u = c
h.o = c
h.x = n
h.w = n
h.p = b
e.v = h
c.p = h
c.x = f
c.t = f
f.u = e
f.v = c
f.o = b
n.u = k
n.o = f
k.s = e
k.v = a
k.q = g
k.y = b
a.s = e
a.v = g
a.q = g
a.y = b
b.u = g
b.o = f
g.s = e
g.v = k
g.q = k
g.y = n
assert k.q.s.v.p.o.o.o.txt == "f"