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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: F = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: F = None
        self.txt = txt

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

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

h = A("h")
f = B("f")
i = C("i")
e = D("e")
l = E("l")
d = F("d")
b = C("b")
m = F("m")

h.y = d
h.s = d
h.q = i
f.y = i
f.w = i
f.t = i
f.r = i
f.p = e
i.v = e
i.y = d
i.r = f
e.w = h
e.t = m
l.s = h
d.s = e
d.y = l
d.x = l
d.p = m
d.t = f
d.r = i
b.v = e
b.y = d
b.r = f
m.s = e
m.y = l
m.x = l
m.p = d
m.t = f
m.r = i
assert i.r.p.w.q.r.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: C = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: F = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: F = None
        self.txt = txt

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

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

h = A("h")
f = B("f")
i = C("i")
e = D("e")
l = E("l")
d = F("d")
b = C("b")
m = F("m")

h.y = d
h.s = d
h.q = i
f.y = i
f.w = i
f.t = i
f.r = i
f.p = e
i.v = e
i.y = d
i.r = f
e.w = h
e.t = m
l.s = h
d.s = e
d.y = l
d.x = l
d.p = m
d.t = f
d.r = i
b.v = e
b.y = d
b.r = f
m.s = e
m.y = l
m.x = l
m.p = d
m.t = f
m.r = i
assert i.r.p.w.q.r.p.t.txt == "m"