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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: C = None
        self.t: C = None
        self.v: F = None
        self.txt = txt

h = A("h")
l = B("l")
f = C("f")
c = D("c")
m = E("m")
e = F("e")
b = G("b")
n = G("n")
a = B("a")

h.s = c
h.t = b
l.p = c
l.v = h
l.z = m
l.w = e
l.y = f
f.r = c
f.q = e
f.w = a
c.t = n
c.w = h
m.t = c
e.z = f
e.o = f
b.q = h
b.o = f
b.t = f
b.v = e
n.q = h
n.o = f
n.t = f
n.v = e
a.p = c
a.v = h
a.z = m
a.w = e
a.y = f
assert e.o.r.t.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: C = None
        self.t: C = None
        self.v: F = None
        self.txt = txt

h = A("h")
l = B("l")
f = C("f")
c = D("c")
m = E("m")
e = F("e")
b = G("b")
n = G("n")
a = B("a")

h.s = c
h.t = b
l.p = c
l.v = h
l.z = m
l.w = e
l.y = f
f.r = c
f.q = e
f.w = a
c.t = n
c.w = h
m.t = c
e.z = f
e.o = f
b.q = h
b.o = f
b.t = f
b.v = e
n.q = h
n.o = f
n.t = f
n.v = e
a.p = c
a.v = h
a.z = m
a.w = e
a.y = f
assert e.o.r.t.o.w.txt == "a"