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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: D = None
        self.v: D = None
        self.y: E = None
        self.p: C = None
        self.q: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: B = None
        self.y: C = None
        self.r: B = None
        self.txt = txt

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

k = A("k")
j = B("j")
l = C("l")
e = D("e")
g = E("g")
f = F("f")
a = A("a")
m = A("m")
h = D("h")

k.o = h
k.y = j
k.r = a
j.v = a
j.p = g
l.w = e
l.u = g
e.s = k
e.o = h
e.v = h
e.q = h
e.y = g
e.p = l
g.x = k
g.t = j
g.r = j
g.y = l
f.s = h
f.u = j
a.o = e
a.y = j
a.r = k
m.o = e
m.y = j
m.r = a
h.s = k
h.o = e
h.v = e
h.q = e
h.y = g
h.p = l
assert e.s.o.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: B = None
        self.r: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: D = None
        self.v: D = None
        self.y: E = None
        self.p: C = None
        self.q: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: B = None
        self.y: C = None
        self.r: B = None
        self.txt = txt

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

k = A("k")
j = B("j")
l = C("l")
e = D("e")
g = E("g")
f = F("f")
a = A("a")
m = A("m")
h = D("h")

k.o = h
k.y = j
k.r = a
j.v = a
j.p = g
l.w = e
l.u = g
e.s = k
e.o = h
e.v = h
e.q = h
e.y = g
e.p = l
g.x = k
g.t = j
g.r = j
g.y = l
f.s = h
f.u = j
a.o = e
a.y = j
a.r = k
m.o = e
m.y = j
m.r = a
h.s = k
h.o = e
h.v = e
h.q = e
h.y = g
h.p = l
assert e.s.o.s.r.txt == "a"