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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

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

g.x = h
f.z = j
i.y = j
k.z = l
k.s = f
k.p = f
k.y = g
k.w = g
k.r = h
j.p = f
j.z = l
j.r = i
j.x = g
h.y = d
h.s = i
h.z = l
d.z = l
d.s = f
d.p = f
d.y = g
d.w = g
d.r = m
m.y = l
m.s = i
m.z = k
l.z = d
l.s = f
l.p = f
l.y = g
l.w = g
l.r = m
assert i.y.z.r.y.r.s.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

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

g.x = h
f.z = j
i.y = j
k.z = l
k.s = f
k.p = f
k.y = g
k.w = g
k.r = h
j.p = f
j.z = l
j.r = i
j.x = g
h.y = d
h.s = i
h.z = l
d.z = l
d.s = f
d.p = f
d.y = g
d.w = g
d.r = m
m.y = l
m.s = i
m.z = k
l.z = d
l.s = f
l.p = f
l.y = g
l.w = g
l.r = m
assert i.y.z.r.y.r.s.y.p.txt == "f"