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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.q: E = None
        self.p: B = None
        self.t: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: B = None
        self.x: A = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

c.q = g
c.w = d
c.s = j
i.o = d
i.y = n
i.r = n
i.z = h
i.x = h
n.u = i
n.w = i
n.p = i
n.q = f
n.t = j
k.w = i
f.p = h
f.t = j
f.v = a
f.y = n
f.u = c
a.q = k
a.o = i
a.x = c
a.v = g
d.s = f
h.p = f
h.t = j
h.v = a
h.y = n
h.u = g
j.w = i
g.q = c
g.w = d
g.s = j
assert i.r.t.w.r.q.u.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: G = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.q: E = None
        self.p: B = None
        self.t: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: B = None
        self.x: A = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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