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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: E = None
        self.q: D = None
        self.s: C = None
        self.v: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: E = None
        self.q: D = None
        self.s: C = None
        self.v: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

l.z = g
a.y = h
a.q = h
a.t = h
a.r = c
a.v = c
a.s = j
j.p = a
j.x = c
j.w = c
j.q = h
h.x = a
h.z = j
h.r = l
h.v = c
h.q = c
c.y = j
c.p = j
c.q = a
c.r = g
c.z = l
g.r = a
g.q = h
g.o = l
assert l.z.r.v.q.txt == "a"