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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: F = None
        self.z: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: E = None
        self.p: D = None
        self.txt = txt

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

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

e.r = g
e.y = h
h.v = a
h.q = d
h.z = i
a.s = e
a.y = h
a.w = c
a.o = g
c.w = a
g.r = d
g.y = f
g.p = c
d.r = c
b.s = e
b.y = h
b.w = c
b.o = g
i.r = g
i.y = h
f.r = d
f.y = g
f.p = c
assert c.w.y.z.r.p.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: F = None
        self.z: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: E = None
        self.p: D = None
        self.txt = txt

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

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

e.r = g
e.y = h
h.v = a
h.q = d
h.z = i
a.s = e
a.y = h
a.w = c
a.o = g
c.w = a
g.r = d
g.y = f
g.p = c
d.r = c
b.s = e
b.y = h
b.w = c
b.o = g
i.r = g
i.y = h
f.r = d
f.y = g
f.p = c
assert c.w.y.z.r.p.w.s.txt == "e"