class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: B = None
        self.v: E = None
        self.t: A = None
        self.q: B = None
        self.w: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: E = None
        self.y: F = None
        self.txt = txt

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

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

h = A("h")
l = B("l")
d = C("d")
c = D("c")
j = E("j")
e = F("e")
m = A("m")
k = B("k")
i = E("i")

h.o = e
h.y = k
h.v = j
h.t = m
h.q = l
h.w = d
l.y = d
l.o = c
l.p = c
l.z = k
d.w = c
c.q = d
c.w = i
c.y = e
j.s = c
j.t = i
e.q = h
m.o = e
m.y = l
m.v = i
m.t = h
m.q = k
m.w = d
k.y = d
k.o = c
k.p = c
k.z = l
i.s = c
i.t = j
assert k.p.w.s.q.w.w.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: B = None
        self.v: E = None
        self.t: A = None
        self.q: B = None
        self.w: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: E = None
        self.y: F = None
        self.txt = txt

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

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

h = A("h")
l = B("l")
d = C("d")
c = D("c")
j = E("j")
e = F("e")
m = A("m")
k = B("k")
i = E("i")

h.o = e
h.y = k
h.v = j
h.t = m
h.q = l
h.w = d
l.y = d
l.o = c
l.p = c
l.z = k
d.w = c
c.q = d
c.w = i
c.y = e
j.s = c
j.t = i
e.q = h
m.o = e
m.y = l
m.v = i
m.t = h
m.q = k
m.w = d
k.y = d
k.o = c
k.p = c
k.z = l
i.s = c
i.t = j
assert k.p.w.s.q.w.w.s.y.txt == "e"