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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: A = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

n.o = e
n.y = e
n.x = j
j.s = d
j.q = b
j.r = f
d.z = j
d.y = i
i.s = j
i.y = e
i.o = f
i.v = f
i.u = d
f.s = n
f.w = c
e.t = j
k.o = e
k.x = j
k.y = c
c.t = j
b.o = e
b.x = j
b.y = c
h.o = e
h.x = j
h.y = c
assert k.o.t.q.o.t.q.y.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: B = None
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: A = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

n.o = e
n.y = e
n.x = j
j.s = d
j.q = b
j.r = f
d.z = j
d.y = i
i.s = j
i.y = e
i.o = f
i.v = f
i.u = d
f.s = n
f.w = c
e.t = j
k.o = e
k.x = j
k.y = c
c.t = j
b.o = e
b.x = j
b.y = c
h.o = e
h.x = j
h.y = c
assert k.o.t.q.o.t.q.y.t.q.txt == "b"