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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: G = None
        self.t: F = None
        self.q: B = None
        self.w: D = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: B = None
        self.t: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: D = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: C = None
        self.q: D = None
        self.s: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: G = None
        self.t: F = None
        self.q: B = None
        self.w: D = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: B = None
        self.t: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: D = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: C = None
        self.q: D = None
        self.s: A = None
        self.txt = txt

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

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

g.q = l
a.o = e
d.z = h
d.o = e
d.t = l
d.q = a
d.w = b
d.r = c
b.q = l
b.y = l
b.w = h
b.r = d
h.q = a
h.z = a
h.t = n
l.x = c
l.q = c
l.r = b
e.u = g
e.s = g
e.p = d
e.q = b
c.w = j
c.y = d
n.q = a
n.z = a
n.t = h
j.q = l
j.y = l
j.w = n
j.r = d
assert b.q.r.w.t.q.o.q.r.q.txt == "a"