class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: E = None
        self.q: F = None
        self.t: E = None
        self.w: D = None
        self.s: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

i.p = a
i.x = e
i.t = e
i.q = j
i.s = j
i.w = h
f.t = d
a.s = d
a.o = d
a.y = i
a.p = j
h.y = j
h.x = j
h.s = e
e.v = j
j.o = i
j.w = e
j.q = h
d.t = l
l.t = f
assert h.s.v.o.w.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: E = None
        self.q: F = None
        self.t: E = None
        self.w: D = None
        self.s: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

i.p = a
i.x = e
i.t = e
i.q = j
i.s = j
i.w = h
f.t = d
a.s = d
a.o = d
a.y = i
a.p = j
h.y = j
h.x = j
h.s = e
e.v = j
j.o = i
j.w = e
j.q = h
d.t = l
l.t = f
assert h.s.v.o.w.x.q.txt == "h"