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

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

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

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: A = None
        self.o: B = None
        self.w: E = None
        self.y: C = None
        self.s: E = None
        self.txt = txt

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

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

l = A("l")
k = B("k")
j = C("j")
h = D("h")
g = E("g")
f = F("f")
i = D("i")
b = F("b")

l.s = i
k.t = h
k.x = l
k.r = j
k.q = j
j.r = b
j.o = h
j.w = g
j.x = l
j.t = i
h.q = i
h.z = l
h.o = k
h.w = g
h.s = g
h.y = j
g.p = k
g.r = l
f.q = k
f.y = b
i.q = h
i.z = l
i.o = k
i.w = g
i.s = g
i.y = j
b.q = k
b.y = f
assert g.r.s.y.t.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: A = None
        self.o: B = None
        self.w: E = None
        self.y: C = None
        self.s: E = None
        self.txt = txt

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

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

l = A("l")
k = B("k")
j = C("j")
h = D("h")
g = E("g")
f = F("f")
i = D("i")
b = F("b")

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