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

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

b = A("b")
e = B("e")
d = C("d")
j = D("j")
a = E("a")
c = F("c")
k = G("k")
n = B("n")
h = A("h")

b.s = j
b.w = e
e.s = n
e.v = b
d.w = h
d.q = j
d.y = c
d.t = b
d.s = a
j.v = a
j.z = a
j.y = h
j.o = h
j.r = n
a.o = e
c.z = d
k.y = e
k.o = a
n.s = e
n.v = b
h.s = j
h.w = n
assert h.s.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

b = A("b")
e = B("e")
d = C("d")
j = D("j")
a = E("a")
c = F("c")
k = G("k")
n = B("n")
h = A("h")

b.s = j
b.w = e
e.s = n
e.v = b
d.w = h
d.q = j
d.y = c
d.t = b
d.s = a
j.v = a
j.z = a
j.y = h
j.o = h
j.r = n
a.o = e
c.z = d
k.y = e
k.o = a
n.s = e
n.v = b
h.s = j
h.w = n
assert h.s.y.s.txt == "j"