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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: A = None
        self.o: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: A = None
        self.s: E = None
        self.x: E = None
        self.w: E = None
        self.txt = txt

b = A("b")
h = B("h")
m = C("m")
k = D("k")
i = E("i")
c = F("c")
n = E("n")
g = C("g")
e = F("e")
d = D("d")

b.s = g
b.o = m
h.w = b
h.y = d
m.v = n
m.w = b
m.o = b
k.v = b
k.t = n
i.p = k
i.w = b
i.z = n
i.t = h
i.s = h
c.p = g
c.z = b
c.s = n
c.x = n
c.w = n
n.p = d
n.w = b
n.z = i
n.t = h
n.s = h
g.v = n
g.w = b
g.o = b
e.p = m
e.z = b
e.s = n
e.x = n
e.w = i
d.v = b
d.t = i
assert h.w.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: A = None
        self.o: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: A = None
        self.s: E = None
        self.x: E = None
        self.w: E = None
        self.txt = txt

b = A("b")
h = B("h")
m = C("m")
k = D("k")
i = E("i")
c = F("c")
n = E("n")
g = C("g")
e = F("e")
d = D("d")

b.s = g
b.o = m
h.w = b
h.y = d
m.v = n
m.w = b
m.o = b
k.v = b
k.t = n
i.p = k
i.w = b
i.z = n
i.t = h
i.s = h
c.p = g
c.z = b
c.s = n
c.x = n
c.w = n
n.p = d
n.w = b
n.z = i
n.t = h
n.s = h
g.v = n
g.w = b
g.o = b
e.p = m
e.z = b
e.s = n
e.x = n
e.w = i
d.v = b
d.t = i
assert h.w.o.w.txt == "b"