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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: D = None
        self.t: E = None
        self.w: B = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

i = A("i")
g = B("g")
l = C("l")
m = D("m")
h = E("h")
k = F("k")
d = D("d")

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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: D = None
        self.t: E = None
        self.w: B = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

i = A("i")
g = B("g")
l = C("l")
m = D("m")
h = E("h")
k = F("k")
d = D("d")

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