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

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

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

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

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

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

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

j.o = a
j.t = g
j.w = g
j.u = i
i.u = j
i.w = d
i.p = d
i.s = h
g.t = h
h.w = n
h.p = n
h.r = a
h.q = a
h.u = g
a.x = g
d.q = g
d.p = i
n.w = h
n.p = h
n.r = a
n.q = a
n.u = g
assert a.x.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: C = None
        self.w: C = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

j.o = a
j.t = g
j.w = g
j.u = i
i.u = j
i.w = d
i.p = d
i.s = h
g.t = h
h.w = n
h.p = n
h.r = a
h.q = a
h.u = g
a.x = g
d.q = g
d.p = i
n.w = h
n.p = h
n.r = a
n.q = a
n.u = g
assert a.x.t.q.txt == "a"