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

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: F = None
        self.y: B = None
        self.o: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: A = None
        self.v: A = None
        self.q: B = None
        self.u: C = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: C = None
        self.o: A = None
        self.v: F = None
        self.t: C = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: C = None
        self.txt = txt

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

b.p = a
b.q = m
b.s = j
h.q = i
h.t = j
h.o = j
h.y = g
m.t = j
m.o = g
a.t = g
a.s = b
a.v = b
a.q = h
a.u = m
a.y = j
n.p = m
n.u = m
n.t = m
n.o = k
n.v = j
n.r = a
j.u = i
j.y = m
g.q = h
g.y = h
g.t = j
g.o = j
i.q = h
i.t = j
i.o = j
i.y = g
k.p = a
k.q = m
k.s = j
assert j.u.o.y.o.y.y.o.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: C = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: F = None
        self.y: B = None
        self.o: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: A = None
        self.v: A = None
        self.q: B = None
        self.u: C = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: C = None
        self.o: A = None
        self.v: F = None
        self.t: C = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: C = None
        self.txt = txt

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

b.p = a
b.q = m
b.s = j
h.q = i
h.t = j
h.o = j
h.y = g
m.t = j
m.o = g
a.t = g
a.s = b
a.v = b
a.q = h
a.u = m
a.y = j
n.p = m
n.u = m
n.t = m
n.o = k
n.v = j
n.r = a
j.u = i
j.y = m
g.q = h
g.y = h
g.t = j
g.o = j
i.q = h
i.t = j
i.o = j
i.y = g
k.p = a
k.q = m
k.s = j
assert j.u.o.y.o.y.y.o.y.o.txt == "g"