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

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: C = None
        self.p: B = None
        self.r: C = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: F = None
        self.z: B = None
        self.o: C = None
        self.x: A = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: C = None
        self.x: A = None
        self.z: B = None
        self.y: E = None
        self.u: A = None
        self.txt = txt

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

c.s = j
c.x = i
c.p = a
e.q = c
k.o = a
i.t = c
i.w = h
i.r = h
i.p = e
i.y = e
j.q = c
j.x = c
j.u = d
j.z = e
j.v = e
j.o = k
d.p = k
d.v = h
d.x = c
d.u = c
d.z = e
d.y = a
a.q = c
a.x = c
a.u = d
a.z = e
a.v = e
a.o = k
h.o = a
assert i.r.o.q.x.t.s.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: D = None
        self.p: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: C = None
        self.p: B = None
        self.r: C = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: F = None
        self.z: B = None
        self.o: C = None
        self.x: A = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: C = None
        self.x: A = None
        self.z: B = None
        self.y: E = None
        self.u: A = None
        self.txt = txt

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

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