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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

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

j.t = k
j.x = k
j.s = l
a.q = k
a.r = l
g.u = l
g.z = h
g.v = j
g.s = k
k.p = l
h.v = g
h.o = k
h.r = k
h.u = k
l.v = a
l.r = k
l.p = j
assert h.o.p.p.s.txt == "l"