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

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

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

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

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

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

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

a.r = l
a.p = l
a.w = d
a.q = h
a.o = h
h.s = g
h.r = i
h.t = i
h.y = d
h.x = d
g.p = h
g.q = a
g.y = i
g.r = f
f.p = d
i.x = h
i.p = f
i.q = f
i.o = l
i.z = l
i.r = l
l.r = g
l.x = g
l.z = f
l.s = f
d.p = h
d.q = a
d.y = i
d.r = f
assert l.r.q.o.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: C = None
        self.q: B = None
        self.p: F = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

a.r = l
a.p = l
a.w = d
a.q = h
a.o = h
h.s = g
h.r = i
h.t = i
h.y = d
h.x = d
g.p = h
g.q = a
g.y = i
g.r = f
f.p = d
i.x = h
i.p = f
i.q = f
i.o = l
i.z = l
i.r = l
l.r = g
l.x = g
l.z = f
l.s = f
d.p = h
d.q = a
d.y = i
d.r = f
assert l.r.q.o.y.q.txt == "a"