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

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: A = None
        self.o: C = None
        self.p: F = None
        self.v: C = None
        self.x: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: D = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: E = None
        self.o: C = None
        self.t: D = None
        self.x: B = None
        self.z: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: A = None
        self.o: C = None
        self.p: F = None
        self.v: C = None
        self.x: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: D = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: E = None
        self.o: C = None
        self.t: D = None
        self.x: B = None
        self.z: C = None
        self.txt = txt

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

b.x = h
b.q = d
a.o = j
a.x = j
a.y = d
a.p = d
a.s = b
i.t = l
i.o = l
i.v = l
i.x = l
i.z = b
i.p = h
d.z = h
d.s = b
j.t = a
j.o = d
j.x = h
h.q = j
h.r = j
h.o = i
h.t = d
h.x = a
h.z = l
l.t = i
l.o = i
l.v = i
l.x = i
l.z = b
l.p = h
assert h.q.t.s.txt == "b"