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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: G = None
        self.w: D = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: B = None
        self.p: F = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: G = None
        self.t: D = None
        self.p: G = None
        self.q: C = None
        self.u: D = None
        self.v: D = None
        self.txt = txt

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

f = A("f")
j = B("j")
a = C("a")
m = D("m")
b = E("b")
n = F("n")
d = G("d")
h = E("h")

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: G = None
        self.w: D = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: B = None
        self.p: F = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: G = None
        self.t: D = None
        self.p: G = None
        self.q: C = None
        self.u: D = None
        self.v: D = None
        self.txt = txt

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

f = A("f")
j = B("j")
a = C("a")
m = D("m")
b = E("b")
n = F("n")
d = G("d")
h = E("h")

f.s = n
j.x = d
j.v = h
a.q = f
a.o = f
a.r = d
a.w = m
m.u = d
m.t = b
b.t = d
b.o = j
b.q = j
b.p = n
n.z = j
n.y = d
n.p = d
n.t = m
n.u = m
n.v = m
n.q = a
d.o = h
d.v = m
d.w = a
h.t = d
h.o = j
h.q = j
h.p = n
assert j.v.q.v.t.o.q.x.v.txt == "m"