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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

d.s = h
d.o = h
d.p = h
d.r = j
k.w = b
k.r = e
k.z = m
j.v = b
j.y = b
j.o = f
j.z = k
j.p = e
f.z = h
f.r = h
f.o = b
h.o = b
b.v = f
b.w = h
b.r = j
m.s = h
m.o = h
m.p = h
m.r = e
e.v = b
e.y = b
e.o = f
e.z = g
e.p = j
g.w = b
g.r = e
g.z = m
assert f.o.r.o.r.o.r.o.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: E = None
        self.r: C = None
        self.p: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

d.s = h
d.o = h
d.p = h
d.r = j
k.w = b
k.r = e
k.z = m
j.v = b
j.y = b
j.o = f
j.z = k
j.p = e
f.z = h
f.r = h
f.o = b
h.o = b
b.v = f
b.w = h
b.r = j
m.s = h
m.o = h
m.p = h
m.r = e
e.v = b
e.y = b
e.o = f
e.z = g
e.p = j
g.w = b
g.r = e
g.z = m
assert f.o.r.o.r.o.r.o.o.w.txt == "h"