class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: A = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.t: F = None
        self.p: B = None
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: E = None
        self.v: A = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: E = None
        self.z: F = None
        self.u: B = None
        self.txt = txt

f = A("f")
i = B("i")
n = C("n")
d = D("d")
a = E("a")
g = F("g")
j = G("j")
h = C("h")
e = F("e")

f.x = e
f.y = a
i.p = n
i.z = e
i.o = j
i.s = h
n.u = g
n.s = f
n.v = j
d.v = j
d.t = e
d.p = i
d.s = i
a.o = d
g.u = f
g.v = f
g.q = a
g.z = j
j.y = e
j.z = e
j.v = a
j.u = i
h.u = e
h.s = f
h.v = j
e.u = f
e.v = f
e.q = a
e.z = j
assert g.q.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: A = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.t: F = None
        self.p: B = None
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: E = None
        self.v: A = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: E = None
        self.z: F = None
        self.u: B = None
        self.txt = txt

f = A("f")
i = B("i")
n = C("n")
d = D("d")
a = E("a")
g = F("g")
j = G("j")
h = C("h")
e = F("e")

f.x = e
f.y = a
i.p = n
i.z = e
i.o = j
i.s = h
n.u = g
n.s = f
n.v = j
d.v = j
d.t = e
d.p = i
d.s = i
a.o = d
g.u = f
g.v = f
g.q = a
g.z = j
j.y = e
j.z = e
j.v = a
j.u = i
h.u = e
h.s = f
h.v = j
e.u = f
e.v = f
e.q = a
e.z = j
assert g.q.o.s.txt == "i"