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

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: F = None
        self.o: F = None
        self.p: B = None
        self.w: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: B = None
        self.s: F = None
        self.y: D = None
        self.txt = txt

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

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

j.w = m
k.z = c
k.p = c
k.t = m
k.o = m
k.w = m
h.s = j
h.p = m
h.o = c
h.y = b
b.o = f
f.v = j
f.q = c
f.s = m
f.y = b
m.q = e
m.s = k
m.p = h
c.z = k
c.p = k
c.t = m
c.o = m
c.w = m
e.s = j
e.p = m
e.o = k
e.y = b
assert c.o.p.y.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: F = None
        self.o: F = None
        self.p: B = None
        self.w: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: B = None
        self.s: F = None
        self.y: D = None
        self.txt = txt

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

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

j.w = m
k.z = c
k.p = c
k.t = m
k.o = m
k.w = m
h.s = j
h.p = m
h.o = c
h.y = b
b.o = f
f.v = j
f.q = c
f.s = m
f.y = b
m.q = e
m.s = k
m.p = h
c.z = k
c.p = k
c.t = m
c.o = m
c.w = m
e.s = j
e.p = m
e.o = k
e.y = b
assert c.o.p.y.o.s.txt == "m"