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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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